prefix output with ./ in example
authorJoey Hess <joeyh@joeyh.name>
Thu, 6 Mar 2025 18:42:07 +0000 (14:42 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 6 Mar 2025 18:42:07 +0000 (14:42 -0400)
doc/design/compute_special_remote_interface.mdwn

index 869883f918b2c231605e45aef8731a6a41862b6b..2c97946a81a33c1a45f3386965f63a14d83a1336 100644 (file)
@@ -100,8 +100,11 @@ An example `git-annex-compute-foo` shell script follows:
     echo "INPUT $2"
     read input
     echo "OUTPUT $3"
+    # Prefixing with ./ makes sure that the output is treated as a
+    # filename, rather than a dashed option.
+    output="./$3"
     echo REPRODUCIBLE
     if [ -n "$input" ]; then
-        mkdir -p "$(dirname "$3")"
-        frobnicate --passes="$ANNEX_COMPUTE_passes" <"$input" >"$3"
+        mkdir -p "$(dirname "$output")"
+        frobnicate --passes="$ANNEX_COMPUTE_passes" <"$input" >"$output"
     fi